name: Platformer Generated sis-uat-workflow Build
'on':
  push:
    branches:
      - UAT
jobs:
  build:
    runs-on:
      - ubuntu-latest
    env:
      SERVICE_NAME: docker.pkg.github.com/moe-lk/sis-php/sis-php
      CONTAINER_REGISTRY: docker.pkg.github.com
    steps:
      - uses: actions/checkout@v2
      - name: Set Version
        id: event-version
        run: echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/heads/}-${{github.sha}}
      - name: Login to GitHub Container Registry
        uses: docker/login-action@v1
        with:
          registry: ${{ env.CONTAINER_REGISTRY }}
          username: ${{ github.actor }}
          password: ${{ secrets.DOCKER_PASSWORD_3AAC49E0_76C1_4B62_8482_1BC7DD83135C }}
      - name: Build the Docker image
        run: docker build --tag ${SERVICE_NAME}:${{steps.event-version.outputs.SOURCE_TAG }} --file Dockerfile .
      - name: GitHub Image Push
        run: docker push $SERVICE_NAME:${{steps.event-version.outputs.SOURCE_TAG }}
      - name: Platformer Deploy
        uses: platformer-com/build-deploy-action@v1
        with:
          org-id: ${{secrets.ORG_ID_425FE435_0A0E_4EE0_88F0_65E62BC6143C}}
          project-id: ${{secrets.PROJECT_ID_425FE435_0A0E_4EE0_88F0_65E62BC6143C}}
          token: ${{secrets.AUTOGENERATED_CICD_425FE435_0A0E_4EE0_88F0_65E62BC6143C}}
          image-name: ${{env.SERVICE_NAME}}
          tag: ${{steps.event-version.outputs.SOURCE_TAG }}
          container-id: 5c14849e-0f88-416b-a9b2-8b0ad3ce07fc
          domain: "https://api.platformer.com"
